﻿create PROCEDURE Sync.SP_CommitteeBankAccount_SelectChanges
@LastRowVersion rowversion,
@FilterdColumn UNIQUEIDENTIFIER
AS 
BEGIN 
	SELECT 
        t.[CommitteeBankAccountID],
		g.[CommitteeID],g.[BankAccountNumber],g.[ProjectID],g.[Balance],
		t.IsDeleted,
		t.LastUpdatedDate
	FROM [dbo].[CommitteeBankAccount] g RIGHT JOIN Sync.CommitteeBankAccount_Tracking t  
    ON t.CommitteeBankAccountID = g.CommitteeBankAccountID 
	WHERE (@LastRowVersion IS NULL OR t.Version > @LastRowVersion)
        AND (@FilterdColumn IS NULL OR g.CommitteeID = @FilterdColumn)
    END











